<?php
	$this->title = "Index User |";
	$this->headTitle($this->title);
?>
<form method="post" action="<?php echo $this->url(array('controller' => 'user', 'action' => 'index')); ?>">
	<p id="adminlist-topcontrol">
		<a class="AddNewHoOrHBLink" href="<?php echo $this->url(array('controller'=>'user', 'action'=>'add', 'page' => null, "limit"=> null));?>">Add new user</a>
	</p>
	<table class="adminlist" border="1px">
		<thead>			
			<?php
				// Display pagination control
				echo $this->paginationControl($this->paginator, 'Sliding', '/partials/paginator.phtml', array("colspan" => 6));
			?>
			<tr>				
				<th width="15%">
					User Name
				</th>
				<th width="15%">
					User Login Name
				</th>
				<th width="10%">
					User Role
				</th>
				<th width="10%">
					User Email
				</th>
				<th width="5%">
					Active
				</th>		
				<th width="15%">
					&nbsp;
				</th>
			</tr>
		</thead>
		<tfoot>
			<?php
				// Display pagination control
				echo $this->paginationControl($this->paginator, 'Sliding', '/partials/paginator.phtml', array("colspan" => 6));
			?>
		</tfoot>
		<tbody>
		<?php 
			if ( 0 == count($this->resultSet)){
				echo $this->partial('/partials/paginator_nodata.phtml', array("colspan" => 6));
			}				
		?>
		<?php foreach($this->resultSet as $user ):?>
			<tr>	
				<td class="center">
					<?php echo $this->escape($user->getUserName());?>
				 </td>
				<td class="center">
					<?php echo $this->escape($user->getUserLoginName());?>				
				</td>
				<td class="center">
					<?php echo $this->escape($user->getUserRole());?>				
				</td>
				<td class="center">
					<?php echo $this->escape($user->getUserEmail());?>				
				</td>
				<td class="center">
					<?php echo $this->escape($user->getUserIsActive());?>				
				</td>
				<td class="center">
					<a href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'user', 'action'=>'viewdetail',
					'userid'=>$this->escape($user->getUserId()), 'page' => null, "limit"=> null));?>">Details</a>|
					<a href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'user', 'action'=>'edit',
					'userid'=>$this->escape($user->getUserId()), 'page' => null, "limit"=> null));?>">Edit</a> |
					<a href="<?php echo $this->url(array('module'=>'admin', 'controller'=>'user','action'=>'delete',
					'userid'=>$this->escape($user->getUserId()), 'page' => null, "limit"=> null));?>">Delete</a>
				</td>
			</tr>		
			<?php endforeach;?>
		</tbody>
	</table>
</form>	